

<form nz-form #validateForm="ngForm" (ngSubmit)="submitForm()" nzLayout="horizontal" autocomplete="off">
    <!-- 模态框头部 -->
    <div class="modal-header">
        <div class="modal-title">
            <i class="anticon anticon-medicine-box mr-sm"></i>
            <span *ngIf="entity.id">{{l('Edit')}}</span>
            <span *ngIf="!entity.id">{{l('Create')}}</span>
        </div>
    </div>
    <!-- 模态框内容 -->
    <fieldset>
        <!-- 提示信息 -->
        <!-- <nz-alert nzType="info" nzCloseable [nzShowIcon]="true" nzMessage="l('我想提示点什么内容给你说')"></nz-alert> -->
            <nz-form-item nz-row>
                    <nz-form-label nz-col [nzSm]="6" [nzXs]="24" nzRequired nzFor="ticketStationId">{{l('TicketStationId')}}</nz-form-label>
                <nz-form-control nz-col [nzSm]="14" [nzXs]="24" nzHasFeedback>
                            <input nz-input name="ticketStationId" #ticketStationId="ngModel"
                                   [(ngModel)]="entity.ticketStationId"
                                   [placeholder]="l('TicketStationId')"  required >

                            <!-- 校验 -->
                            <nz-form-explain *ngIf="ticketStationId.control.dirty&&ticketStationId.control.errors">
                                                                <ng-container *ngIf="ticketStationId.control.hasError('required')">{{l('CanNotNull')}}</ng-container>
                            </nz-form-explain>

                </nz-form-control>
            </nz-form-item>
            <nz-form-item nz-row>
                    <nz-form-label nz-col [nzSm]="6" [nzXs]="24" nzRequired nzFor="deviceCode">{{l('DeviceCode')}}</nz-form-label>
                <nz-form-control nz-col [nzSm]="14" [nzXs]="24" nzHasFeedback>
                            <input nz-input name="deviceCode" #deviceCode="ngModel"
                                   [(ngModel)]="entity.deviceCode"
                                   [placeholder]="l('DeviceCode')"  required >

                            <!-- 校验 -->
                            <nz-form-explain *ngIf="deviceCode.control.dirty&&deviceCode.control.errors">
                                                                <ng-container *ngIf="deviceCode.control.hasError('required')">{{l('CanNotNull')}}</ng-container>
                            </nz-form-explain>

                </nz-form-control>
            </nz-form-item>
            <nz-form-item nz-row>
                    <nz-form-label nz-col [nzSm]="6" [nzXs]="24" nzRequired nzFor="deviceName">{{l('DeviceName')}}</nz-form-label>
                <nz-form-control nz-col [nzSm]="14" [nzXs]="24" nzHasFeedback>
                            <input nz-input name="deviceName" #deviceName="ngModel"
                                   [(ngModel)]="entity.deviceName"
                                   [placeholder]="l('DeviceName')"  required >

                            <!-- 校验 -->
                            <nz-form-explain *ngIf="deviceName.control.dirty&&deviceName.control.errors">
                                                                <ng-container *ngIf="deviceName.control.hasError('required')">{{l('CanNotNull')}}</ng-container>
                            </nz-form-explain>

                </nz-form-control>
            </nz-form-item>
            <nz-form-item nz-row>
                    <nz-form-label nz-col [nzSm]="6" [nzXs]="24" nzRequired nzFor="iPAddress">{{l('IPAddress')}}</nz-form-label>
                <nz-form-control nz-col [nzSm]="14" [nzXs]="24" nzHasFeedback>
                            <input nz-input name="iPAddress" #iPAddress="ngModel"
                                   [(ngModel)]="entity.iPAddress"
                                   [placeholder]="l('IPAddress')"  required >

                            <!-- 校验 -->
                            <nz-form-explain *ngIf="iPAddress.control.dirty&&iPAddress.control.errors">
                                                                <ng-container *ngIf="iPAddress.control.hasError('required')">{{l('CanNotNull')}}</ng-container>
                            </nz-form-explain>

                </nz-form-control>
            </nz-form-item>
            <nz-form-item nz-row>
                    <nz-form-label nz-col [nzSm]="6" [nzXs]="24" nzRequired nzFor="port">{{l('Port')}}</nz-form-label>
                <nz-form-control nz-col [nzSm]="14" [nzXs]="24" nzHasFeedback>
                            <input nz-input name="port" #port="ngModel"
                                   [(ngModel)]="entity.port"
                                   [placeholder]="l('Port')"  required >

                            <!-- 校验 -->
                            <nz-form-explain *ngIf="port.control.dirty&&port.control.errors">
                                                                <ng-container *ngIf="port.control.hasError('required')">{{l('CanNotNull')}}</ng-container>
                            </nz-form-explain>

                </nz-form-control>
            </nz-form-item>
            <nz-form-item nz-row>
                    <nz-form-label nz-col [nzSm]="6" [nzXs]="24" nzRequired nzFor="deviceType">{{l('DeviceType')}}</nz-form-label>
                <nz-form-control nz-col [nzSm]="14" [nzXs]="24" nzHasFeedback>
                            <input nz-input name="deviceType" #deviceType="ngModel"
                                   [(ngModel)]="entity.deviceType"
                                   [placeholder]="l('DeviceType')"  required >

                            <!-- 校验 -->
                            <nz-form-explain *ngIf="deviceType.control.dirty&&deviceType.control.errors">
                                                                <ng-container *ngIf="deviceType.control.hasError('required')">{{l('CanNotNull')}}</ng-container>
                            </nz-form-explain>

                </nz-form-control>
            </nz-form-item>
            <nz-form-item nz-row>
                    <nz-form-label nz-col [nzSm]="6" [nzXs]="24" nzRequired nzFor="secretKey">{{l('SecretKey')}}</nz-form-label>
                <nz-form-control nz-col [nzSm]="14" [nzXs]="24" nzHasFeedback>
                            <input nz-input name="secretKey" #secretKey="ngModel"
                                   [(ngModel)]="entity.secretKey"
                                   [placeholder]="l('SecretKey')"  required >

                            <!-- 校验 -->
                            <nz-form-explain *ngIf="secretKey.control.dirty&&secretKey.control.errors">
                                                                <ng-container *ngIf="secretKey.control.hasError('required')">{{l('CanNotNull')}}</ng-container>
                            </nz-form-explain>

                </nz-form-control>
            </nz-form-item>
            <nz-form-item nz-row>
                    <nz-form-label nz-col [nzSm]="6" [nzXs]="24" nzRequired nzFor="isEnabled">{{l('IsEnabled')}}</nz-form-label>
                <nz-form-control nz-col [nzSm]="14" [nzXs]="24" nzHasFeedback>
                            <label nz-checkbox name="isEnabled" #isEnabled="ngModel"
                                   [(ngModel)]="entity.isEnabled"  required >{{l('IsEnabled')}}</label>

                            <!-- 校验 -->
                            <nz-form-explain *ngIf="isEnabled.control.dirty&&isEnabled.control.errors">
                                                                <ng-container *ngIf="isEnabled.control.hasError('required')">{{l('CanNotNull')}}</ng-container>
                            </nz-form-explain>

                </nz-form-control>
            </nz-form-item>
            <nz-form-item nz-row>
                    <nz-form-label nz-col [nzSm]="6" [nzXs]="24" nzRequired nzFor="deviceStatus">{{l('DeviceStatus')}}</nz-form-label>
                <nz-form-control nz-col [nzSm]="14" [nzXs]="24" nzHasFeedback>
                            <input nz-input name="deviceStatus" #deviceStatus="ngModel"
                                   [(ngModel)]="entity.deviceStatus"
                                   [placeholder]="l('DeviceStatus')"  required >

                            <!-- 校验 -->
                            <nz-form-explain *ngIf="deviceStatus.control.dirty&&deviceStatus.control.errors">
                                                                <ng-container *ngIf="deviceStatus.control.hasError('required')">{{l('CanNotNull')}}</ng-container>
                            </nz-form-explain>

                </nz-form-control>
            </nz-form-item>

    </fieldset>
    <!-- 模态框底部 -->
    <div class="modal-footer">
        <button nz-button [nzType]="'default'" type="button" (click)="close()" [disabled]="saving">
            <i class="anticon anticon-close-circle-o"></i> {{l("Cancel")}}
        </button>
        <button nz-button [nzType]="'primary'" type="submit" [disabled]="!validateForm.form.valid|| saving" [nzLoading]="saving">
            <i class="anticon anticon-save" *ngIf="!saving"></i> {{l("Save")}}
        </button>
    </div>
</form>





